﻿<Window x:Class="MicroFlasher.Views.SerialMonitor.SerialMonitorWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Serial Monitor"
        Height="300" Width="500"
        MinHeight="300" MinWidth="500"
        WindowStartupLocation="CenterOwner"
        Icon="../../Icons/serial-monitor.png"
        FocusManager.FocusedElement="{Binding ElementName=MessageToSend}"
        Loaded="SerialMonitorWindow_OnLoaded"
        >
    <Window.Resources>
        <Style x:Key="MyMessage" TargetType="Paragraph">
            <Setter Property="Foreground" Value="Green" />
            <Setter Property="Margin" Value="0" />
        </Style>
        <Style x:Key="OtherMessage" TargetType="Paragraph">
            <Setter Property="Foreground" Value="Red" />
            <Setter Property="Margin" Value="0" />
        </Style>
    </Window.Resources>
    <DockPanel LastChildFill="True">
        <DockPanel LastChildFill="True" DockPanel.Dock="Bottom">
            <Button Content="Send" HorizontalAlignment="Center" DockPanel.Dock="Right" Click="Button_Click" />
            <TextBox x:Name="MessageToSend" VerticalContentAlignment="Center"
                     FontFamily="Consolas" FontSize="16"
                     PreviewKeyDown="MessageToSend_OnPreviewKeyDown"
                     PreviewKeyUp="MessageToSend_OnPreviewKeyUp"
                     KeyDown="MessageToSend_OnKeyDown"
                     ToolTip="Enter message to be sent" />
        </DockPanel>
        <RichTextBox x:Name="MessageLog" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Auto" Padding="5" 
                     FontFamily="Consolas" FontSize="16" >
            <RichTextBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Click="ClearLog" Header="Clear" />
                </ContextMenu>
            </RichTextBox.ContextMenu>
            <FlowDocument></FlowDocument>
        </RichTextBox>
    </DockPanel>
</Window>
